home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / aepopup3 / data1.cab / Popup_Properties_6 / CommandBox.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-05-05  |  21.8 KB  |  596 lines

  1. VERSION 5.00
  2. Object = "{4E36AC7F-0302-11D3-AFE0-B4CDD86B7B11}#1.0#0"; "AePopup6D.OCX"
  3. Begin VB.Form frmCommandBox 
  4.    ClientHeight    =   3765
  5.    ClientLeft      =   60
  6.    ClientTop       =   60
  7.    ClientWidth     =   7320
  8.    ControlBox      =   0   'False
  9.    LinkTopic       =   "Form1"
  10.    MDIChild        =   -1  'True
  11.    ScaleHeight     =   3765
  12.    ScaleWidth      =   7320
  13.    WindowState     =   2  'Maximized
  14.    Begin VB.PictureBox picFrame 
  15.       Appearance      =   0  'Flat
  16.       ClipControls    =   0   'False
  17.       ForeColor       =   &H80000008&
  18.       Height          =   3495
  19.       Left            =   60
  20.       ScaleHeight     =   231
  21.       ScaleMode       =   3  'Pixel
  22.       ScaleWidth      =   475
  23.       TabIndex        =   15
  24.       TabStop         =   0   'False
  25.       Top             =   120
  26.       Width           =   7155
  27.       Begin VB.PictureBox picCustomPopup 
  28.          Appearance      =   0  'Flat
  29.          ForeColor       =   &H80000008&
  30.          Height          =   495
  31.          Left            =   2280
  32.          ScaleHeight     =   31
  33.          ScaleMode       =   3  'Pixel
  34.          ScaleWidth      =   19
  35.          TabIndex        =   21
  36.          Top             =   1200
  37.          Visible         =   0   'False
  38.          Width           =   315
  39.          Begin VB.Label lblPopupPrompt 
  40.             Alignment       =   2  'Center
  41.             BackStyle       =   0  'Transparent
  42.             Height          =   195
  43.             Left            =   60
  44.             TabIndex        =   23
  45.             Top             =   240
  46.             Width           =   195
  47.          End
  48.          Begin VB.Label lblPopupItems 
  49.             BackColor       =   &H80000005&
  50.             Height          =   195
  51.             Index           =   0
  52.             Left            =   60
  53.             TabIndex        =   22
  54.             Top             =   60
  55.             Width           =   195
  56.          End
  57.       End
  58.       Begin VB.Frame frmProperties 
  59.          Caption         =   "Properties"
  60.          Height          =   3250
  61.          Left            =   2640
  62.          TabIndex        =   17
  63.          Top             =   60
  64.          Width           =   4400
  65.          Begin VB.ComboBox cboTextAlignment 
  66.             Height          =   315
  67.             HelpContextID   =   514
  68.             ItemData        =   "CommandBox.frx":0000
  69.             Left            =   2040
  70.             List            =   "CommandBox.frx":0013
  71.             Style           =   2  'Dropdown List
  72.             TabIndex        =   5
  73.             Top             =   720
  74.             Width           =   1875
  75.          End
  76.          Begin VB.ComboBox cboPictureAlignment 
  77.             Height          =   315
  78.             HelpContextID   =   514
  79.             ItemData        =   "CommandBox.frx":005C
  80.             Left            =   2040
  81.             List            =   "CommandBox.frx":006F
  82.             Style           =   2  'Dropdown List
  83.             TabIndex        =   7
  84.             Top             =   1080
  85.             Width           =   1875
  86.          End
  87.          Begin VB.CheckBox chkShowFocus 
  88.             Caption         =   "Show &Focus"
  89.             Height          =   195
  90.             HelpContextID   =   523
  91.             Left            =   360
  92.             TabIndex        =   11
  93.             Top             =   2280
  94.             Width           =   1275
  95.          End
  96.          Begin VB.CheckBox chkComboWidth 
  97.             Caption         =   "Combo &Width"
  98.             Enabled         =   0   'False
  99.             Height          =   255
  100.             HelpContextID   =   506
  101.             Left            =   660
  102.             TabIndex        =   9
  103.             Top             =   1860
  104.             Width           =   1335
  105.          End
  106.          Begin VB.CheckBox chkHasComboButton 
  107.             Caption         =   "&Has Combo Button"
  108.             Height          =   255
  109.             HelpContextID   =   520
  110.             Left            =   360
  111.             TabIndex        =   8
  112.             Top             =   1560
  113.             Width           =   1635
  114.          End
  115.          Begin VB.TextBox txtCaption 
  116.             Height          =   315
  117.             Left            =   1380
  118.             TabIndex        =   3
  119.             Top             =   300
  120.             Width           =   2535
  121.          End
  122.          Begin VB.CheckBox chkShowBorder 
  123.             Caption         =   "Show &Border"
  124.             Height          =   195
  125.             HelpContextID   =   523
  126.             Left            =   1800
  127.             TabIndex        =   12
  128.             Top             =   2280
  129.             Width           =   1275
  130.          End
  131.          Begin AePopup6D.AeEntryBox aebWidth 
  132.             Height          =   315
  133.             HelpContextID   =   506
  134.             Left            =   2040
  135.             TabIndex        =   10
  136.             Top             =   1860
  137.             Width           =   1275
  138.             _ExtentX        =   2249
  139.             _ExtentY        =   556
  140.             Enabled         =   0   'False
  141.             Style           =   0
  142.             ButtonCount     =   2
  143.             Picture1        =   13
  144.             Action1         =   1
  145.             ButtonStyle1    =   0
  146.             ButtonRepeatRate1=   100
  147.             ToolTipText1    =   "Increment"
  148.             Picture2        =   14
  149.             Action2         =   2
  150.             ButtonStyle2    =   0
  151.             ButtonRepeatRate2=   100
  152.             ToolTipText2    =   "Decrement"
  153.             DataType        =   3
  154.          End
  155.          Begin AePopup6D.AeEntryBox aebPopupSymbol 
  156.             Height          =   315
  157.             HelpContextID   =   522
  158.             Left            =   1920
  159.             TabIndex        =   14
  160.             Top             =   2700
  161.             Width           =   1935
  162.             _ExtentX        =   3413
  163.             _ExtentY        =   556
  164.             Enabled         =   0   'False
  165.             AllowEdit       =   0   'False
  166.             Style           =   0
  167.             Picture1        =   31
  168.             Action1         =   3
  169.             ButtonStyle1    =   0
  170.             ToolTipText1    =   "Standard Images"
  171.             ListCount       =   32
  172.             ListNoVisibleItems=   14
  173.             ListItem1       =   "aeNoSymbol"
  174.             ListItem2       =   "aeDownSymbol"
  175.             ListItem3       =   "aeUpSymbol"
  176.             ListItem4       =   "aeLeftSymbol"
  177.             ListItem5       =   "aeRightSymbol"
  178.             ListItem6       =   "aeCalendarSymbol"
  179.             ListItem7       =   "aeClockSymbol"
  180.             ListItem8       =   "aeSearchSymbol"
  181.             ListItem9       =   "aeNewSymbol"
  182.             ListItem10      =   "aeEllipsisSymbol"
  183.             ListItem11      =   "aeCarriageReturnSymbol"
  184.             ListItem12      =   "aeHelpSymbol"
  185.             ListItem13      =   "aeAsteriskSymbol"
  186.             ListItem14      =   "aePlusSymbol"
  187.             ListItem15      =   "aeMinusSymbol"
  188.             ListItem16      =   "aeTickSymbol"
  189.             ListItem17      =   "aeCrossSymbol"
  190.             ListItem18      =   "aeFirstSymbol"
  191.             ListItem19      =   "aeLastSymbol"
  192.             ListItem20      =   "aeMaximiseSymbol"
  193.             ListItem21      =   "aeMinimiseSymbol"
  194.             ListItem22      =   "aeCloseSymbol"
  195.             ListItem23      =   "aeStopSymbol"
  196.             ListItem24      =   "aeRecordSymbol"
  197.             ListItem25      =   "aePlaySymbol"
  198.             ListItem26      =   "aePauseSymbol"
  199.             ListItem27      =   "aeFastForwardSymbol"
  200.             ListItem28      =   "aeRewindSymbol"
  201.             ListItem29      =   "aeLEDOffSymbol"
  202.             ListItem30      =   "aeLEDRedSymbol"
  203.             ListItem31      =   "aeLEDGreenSymbol"
  204.             ListItem32      =   "aeComboSymbol"
  205.          End
  206.          Begin VB.Label lblProperties 
  207.             AutoSize        =   -1  'True
  208.             Caption         =   "&Text Alignment:"
  209.             Height          =   195
  210.             Index           =   3
  211.             Left            =   360
  212.             TabIndex        =   4
  213.             Top             =   780
  214.             Width           =   1095
  215.          End
  216.          Begin VB.Label lblProperties 
  217.             AutoSize        =   -1  'True
  218.             Caption         =   "P&icture Alignment:"
  219.             Height          =   195
  220.             Index           =   4
  221.             Left            =   360
  222.             TabIndex        =   6
  223.             Top             =   1140
  224.             Width           =   1275
  225.          End
  226.          Begin VB.Label lblWidthPxls 
  227.             AutoSize        =   -1  'True
  228.             Caption         =   "pxls"
  229.             ForeColor       =   &H80000010&
  230.             Height          =   195
  231.             Left            =   3360
  232.             TabIndex        =   18
  233.             Top             =   1920
  234.             Width           =   270
  235.          End
  236.          Begin VB.Label lblProperties 
  237.             AutoSize        =   -1  'True
  238.             Caption         =   "&Caption:"
  239.             Height          =   195
  240.             Index           =   2
  241.             Left            =   360
  242.             TabIndex        =   2
  243.             Top             =   360
  244.             Width           =   585
  245.          End
  246.          Begin VB.Label lblProperties 
  247.             AutoSize        =   -1  'True
  248.             Caption         =   "Popup Sy&mbol:"
  249.             Height          =   195
  250.             Index           =   5
  251.             Left            =   360
  252.             TabIndex        =   13
  253.             Top             =   2760
  254.             Width           =   1065
  255.          End
  256.       End
  257.       Begin VB.TextBox txtEvents 
  258.          Appearance      =   0  'Flat
  259.          BackColor       =   &H8000000F&
  260.          BorderStyle     =   0  'None
  261.          Height          =   1455
  262.          Left            =   90
  263.          Locked          =   -1  'True
  264.          MultiLine       =   -1  'True
  265.          ScrollBars      =   2  'Vertical
  266.          TabIndex        =   1
  267.          TabStop         =   0   'False
  268.          Text            =   "CommandBox.frx":00B8
  269.          Top             =   1965
  270.          Width           =   2415
  271.       End
  272.       Begin AePopup6D.AeCommandBox acbAcbGraphical 
  273.          Height          =   195
  274.          HelpContextID   =   501
  275.          Left            =   1560
  276.          TabIndex        =   16
  277.          Top             =   1380
  278.          Width           =   645
  279.          _ExtentX        =   1138
  280.          _ExtentY        =   344
  281.          ForeColor       =   -2147483630
  282.          ShowBorder      =   0   'False
  283.          MaskColor       =   16711680
  284.          Picture         =   "CommandBox.frx":00C1
  285.          PressedPicture  =   "CommandBox.frx":028B
  286.          DisabledPicture =   "CommandBox.frx":0455
  287.          HighlightPicture=   "CommandBox.frx":061F
  288.          Appearance      =   2
  289.          TextAlignment   =   2
  290.          ShowFocus       =   0   'False
  291.       End
  292.       Begin AePopup6D.AeCommandBox acbMain 
  293.          Height          =   975
  294.          HelpContextID   =   501
  295.          Left            =   300
  296.          TabIndex        =   0
  297.          Top             =   180
  298.          Width           =   1995
  299.          _ExtentX        =   3519
  300.          _ExtentY        =   1720
  301.          Picture         =   "CommandBox.frx":07E9
  302.          Caption         =   "&Aebacus"
  303.          TextAlignment   =   0
  304.          PictureAlignment=   0
  305.          ListCount       =   5
  306.          ListItem1       =   "Apples"
  307.          ListItem2       =   "Oranges"
  308.          ListItem3       =   "Pairs"
  309.          ListItem4       =   "Bananas"
  310.          ListItem5       =   "Lemons"
  311.          Menu            =   $"CommandBox.frx":0A7B
  312.       End
  313.       Begin AePopup6D.AeCommandBox acbClearEvents 
  314.          Height          =   195
  315.          Left            =   1950
  316.          TabIndex        =   24
  317.          TabStop         =   0   'False
  318.          ToolTipText     =   "Clear events"
  319.          Top             =   1740
  320.          Width           =   555
  321.          _ExtentX        =   979
  322.          _ExtentY        =   344
  323.          BackColor       =   -2147483632
  324.          ForeColor       =   -2147483628
  325.          Picture         =   "CommandBox.frx":0B53
  326.          Appearance      =   2
  327.          ShowFocus       =   0   'False
  328.       End
  329.       Begin VB.Label lblProperties 
  330.          AutoSize        =   -1  'True
  331.          Caption         =   "Graphical effects:"
  332.          Height          =   195
  333.          Index           =   7
  334.          Left            =   120
  335.          TabIndex        =   20
  336.          Top             =   1380
  337.          Width           =   1245
  338.       End
  339.       Begin VB.Label lblEvents 
  340.          BackColor       =   &H80000010&
  341.          Caption         =   "Events:"
  342.          ForeColor       =   &H80000014&
  343.          Height          =   210
  344.          Left            =   90
  345.          TabIndex        =   19
  346.          Top             =   1740
  347.          Width           =   2415
  348.       End
  349.    End
  350. Attribute VB_Name = "frmCommandBox"
  351. Attribute VB_GlobalNameSpace = False
  352. Attribute VB_Creatable = False
  353. Attribute VB_PredeclaredId = True
  354. Attribute VB_Exposed = False
  355. Option Explicit
  356. 'Windows API
  357. Private Type Rect   '16 Bytes
  358.    Left As Long
  359.    Top As Long
  360.    Right As Long
  361.    Bottom As Long
  362. End Type
  363. Private Declare Function DrawEdge Lib "user32" _
  364.     (ByVal hDC As Long, qrc As Rect, ByVal edge As Long, ByVal grfFlags As Long) As Long
  365. Private Const BF_LEFT = &H1
  366. Private Const BF_TOP = &H2
  367. Private Const BF_RIGHT = &H4
  368. Private Const BF_BOTTOM = &H8
  369. Private Const BF_RECT = (BF_LEFT Or BF_TOP Or BF_RIGHT Or BF_BOTTOM)
  370. Private Const BF_FLAT = &H4000         ' For flat rather than 3D borders
  371. Private Const BF_SOFT = &H1000         ' For softer buttons
  372. Private Const BDR_RAISEDOUTER = &H1
  373. Private Const BDR_SUNKENOUTER = &H2
  374. Private Const BDR_RAISEDINNER = &H4
  375. Private Const BDR_SUNKENINNER = &H8
  376. Private Const M_S_CommandBoxWidth = 0
  377. Private Const M_S_PropsLeft = 1
  378. Private Const M_S_PropsHeight = 2
  379. Private Const M_S_EventsHeight = 3
  380. Private Const M_S_EventsWidth = 4
  381. Private Const M_S_ClearEventsLeft = 5
  382. Private m_Offsets(M_S_CommandBoxWidth To M_S_ClearEventsLeft) As Integer
  383. Private Const M_CustomPopupItemCount = 3
  384. Private WithEvents m_PopupForm As AePopupForm
  385. Attribute m_PopupForm.VB_VarHelpID = -1
  386. Public Property Let Style(ByVal New_Style As AeCommandBoxStyles)
  387.     If New_Style = aeCommandButton Or New_Style = aeSwitchButton Then
  388.         lblProperties(5).ForeColor = vb3DShadow
  389.         aebPopupSymbol.Enabled = False
  390.     Else
  391.         
  392.         lblProperties(5).ForeColor = vbWindowText
  393.         aebPopupSymbol.Enabled = True
  394.     End If
  395.     'hook into popup events only when the aeCustomPopup style selected
  396.     If New_Style = aeCustomPopup Then
  397.         Set m_PopupForm = acbMain.PopupForm
  398.     Else
  399.         Set m_PopupForm = Nothing
  400.     End If
  401.     acbMain.Style = New_Style
  402. End Property
  403. Private Sub acbClearEvents_Click()
  404.     txtEvents.Text = "(none)"
  405. End Sub
  406. Private Sub acbMain_Click()
  407.     p_AddEvent "Click"
  408. End Sub
  409. Private Sub acbMain_ComboClick()
  410.     p_AddEvent "ComboClick"
  411. End Sub
  412. Private Sub acbMain_ListClick(ByVal Index As Integer)
  413.     p_AddEvent "ListClick" & vbTab & CStr(Index)
  414. End Sub
  415. Private Sub acbMain_MenuClick(MenuItem As AePopup6D.AeMenuItem)
  416.     p_AddEvent "MenuClick" & vbTab & CStr(MenuItem.Index)
  417. End Sub
  418. Private Sub acbMain_MenuHighlight(MenuItem As AePopup6D.AeMenuItem)
  419.     p_AddEvent "MenuHighlight" & vbTab & CStr(MenuItem.Index)
  420. End Sub
  421. Private Sub acbMain_MenuPopup(Menu As AePopup6D.AeMenu)
  422.     p_AddEvent "MenuPopup"
  423. End Sub
  424. Private Sub aebPopupSymbol_Change()
  425.     If aebPopupSymbol.List.Index > 0 Then
  426.         acbMain.PopupSymbol = aebPopupSymbol.List.Index - 1
  427.     End If
  428. End Sub
  429. Private Sub aebWidth_Change()
  430.     acbMain.ComboWidth = aebWidth.Value
  431. End Sub
  432. Private Sub cboPictureAlignment_Click()
  433.     acbMain.PictureAlignment = cboPictureAlignment.ListIndex
  434. End Sub
  435. Private Sub cboTextAlignment_Click()
  436.     acbMain.TextAlignment = cboTextAlignment.ListIndex
  437. End Sub
  438. Private Sub chkComboWidth_Click()
  439.     If chkComboWidth.Value = vbChecked Then
  440.         aebWidth.Enabled = True
  441.         lblWidthPxls.ForeColor = vbButtonText
  442.     Else
  443.         aebWidth.Enabled = False
  444.         lblWidthPxls.ForeColor = vbGrayText
  445.         aebWidth.Value = 0
  446.     End If
  447. End Sub
  448. Private Sub chkHasComboButton_Click()
  449.     Dim b As Boolean
  450.     b = (chkHasComboButton.Value = vbChecked)
  451.     acbMain.HasComboButton = b
  452.     If b Then
  453.         chkComboWidth.Enabled = True
  454.     Else
  455.         chkComboWidth.Enabled = False
  456.         chkComboWidth.Value = vbUnchecked
  457.     End If
  458. End Sub
  459. Private Sub chkShowBorder_Click()
  460.     acbMain.ShowBorder = (chkShowBorder.Value = vbChecked)
  461. End Sub
  462. Private Sub chkShowFocus_Click()
  463.     acbMain.ShowFocus = (chkShowFocus.Value = vbChecked)
  464. End Sub
  465. Private Sub lblPopupItems_Click(Index As Integer)
  466.     m_PopupForm.Value = Index
  467.     m_PopupForm.Hide
  468. End Sub
  469. Private Sub lblPopupItems_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  470.     'highlight the current label
  471.     Dim n As Integer
  472.     For n = 0 To M_CustomPopupItemCount - 1
  473.         If Index = n Then
  474.             lblPopupItems(n).BackColor = vbHighlight
  475.             lblPopupItems(n).ForeColor = vbHighlightText
  476.         Else
  477.             lblPopupItems(n).BackColor = vbWindowBackground
  478.             lblPopupItems(n).ForeColor = vbWindowText
  479.         End If
  480.     Next n
  481.     'update the label prompt
  482.     If Index = -1 Then
  483.         lblPopupPrompt.Caption = ""
  484.     Else
  485.         lblPopupPrompt.Caption = lblPopupItems(Index).Caption
  486.     End If
  487. End Sub
  488. Private Sub m_PopupForm_Load(ByVal Modal As Boolean)
  489.     p_AddEvent ("PopupForm_Load")
  490. End Sub
  491. Private Sub m_PopupForm_Unload(Cancel As Boolean, ByVal UnloadMode As Integer)
  492.     If Not m_PopupForm.Cancelled Then
  493.         p_AddEvent "PopupForm_UnLoad" & vbTab & CStr(m_PopupForm.Value)
  494.     End If
  495. End Sub
  496. Private Sub picCustomPopup_Click()
  497.     m_PopupForm.Cancelled = True
  498.     m_PopupForm.Hide
  499. End Sub
  500. Private Sub picCustomPopup_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  501.     lblPopupItems_MouseMove -1, 0, 0, 0, 0
  502. End Sub
  503. Private Sub picCustomPopup_Paint()
  504.     Dim uRect As Rect
  505.     'draw raised border
  506.     uRect.Left = 0
  507.     uRect.Top = 0
  508.     uRect.Right = picCustomPopup.ScaleWidth
  509.     uRect.Bottom = picCustomPopup.ScaleHeight
  510.     DrawEdge picCustomPopup.hDC, uRect, BDR_RAISEDINNER Or BDR_RAISEDOUTER, BF_RECT
  511.             
  512.     'draw prompt inset border
  513.     uRect.Left = lblPopupPrompt.Left - 1
  514.     uRect.Top = lblPopupPrompt.Top - 1
  515.     uRect.Right = uRect.Left + lblPopupPrompt.Width
  516.     uRect.Bottom = uRect.Top + lblPopupPrompt.Height
  517.     DrawEdge picCustomPopup.hDC, uRect, BDR_SUNKENOUTER, BF_RECT
  518. End Sub
  519. Private Sub picCustomPopup_Resize()
  520.     'reposition the 3 labels and prompt label
  521.     Dim n As Integer
  522.     Dim iHeight As Integer
  523.     Dim iWidth As Integer
  524.     iHeight = lblPopupItems(n).Height
  525.     iWidth = picCustomPopup.ScaleWidth
  526.     For n = 0 To M_CustomPopupItemCount - 1
  527.         lblPopupItems(n).Move 2, n * iHeight + 2, iWidth - 4
  528.     Next n
  529.     lblPopupPrompt.Move 8, M_CustomPopupItemCount * iHeight + 8, iWidth - 16, 16
  530. End Sub
  531. Private Sub picFrame_Resize()
  532.     'reposition controls
  533.     acbMain.Width = Abs(picFrame.ScaleWidth - m_Offsets(M_S_CommandBoxWidth))
  534.     frmProperties.Left = Abs(picFrame.ScaleWidth - m_Offsets(M_S_PropsLeft))
  535.     frmProperties.Height = Abs(picFrame.ScaleHeight - m_Offsets(M_S_PropsHeight))
  536.     txtEvents.Height = Abs(picFrame.ScaleHeight - m_Offsets(M_S_EventsHeight))
  537.     txtEvents.Width = Abs(picFrame.ScaleWidth - m_Offsets(M_S_EventsWidth))
  538.     lblEvents.Width = Abs(picFrame.ScaleWidth - m_Offsets(M_S_EventsWidth))
  539.     acbClearEvents.Left = Abs(picFrame.ScaleWidth - m_Offsets(M_S_ClearEventsLeft))
  540. End Sub
  541. Private Sub txtCaption_Change()
  542.     acbMain.Caption = txtCaption.Text
  543. End Sub
  544. 'Form Events
  545. '===========
  546. Private Sub Form_Load()
  547.     txtCaption.Text = acbMain.Caption
  548.     cboTextAlignment.ListIndex = acbMain.TextAlignment
  549.     cboPictureAlignment.ListIndex = acbMain.PictureAlignment
  550.     chkHasComboButton.Value = Abs(acbMain.HasComboButton)
  551.     chkComboWidth.Value = Abs(acbMain.ComboWidth <> 0)
  552.     aebWidth.Value = acbMain.ComboWidth
  553.     chkShowFocus.Value = Abs(acbMain.ShowFocus)
  554.     chkShowBorder.Value = Abs(acbMain.ShowBorder)
  555.     aebPopupSymbol.List.Index = acbMain.PopupSymbol + 1
  556.     'set up resizing frame
  557.     With picFrame
  558.         m_Offsets(M_S_CommandBoxWidth) = .ScaleWidth - acbMain.Width
  559.         m_Offsets(M_S_PropsLeft) = .ScaleWidth - frmProperties.Left
  560.         m_Offsets(M_S_PropsHeight) = .ScaleHeight - frmProperties.Height
  561.         m_Offsets(M_S_EventsHeight) = .ScaleHeight - txtEvents.Height
  562.         m_Offsets(M_S_EventsWidth) = .ScaleWidth - txtEvents.Width
  563.         m_Offsets(M_S_ClearEventsLeft) = .ScaleWidth - acbClearEvents.Left
  564.         .BorderStyle = 0
  565.     End With
  566.     'setup custom popup form
  567.     Dim n As Integer
  568.     lblPopupItems(n).Caption = "Undo 1 level"
  569.     For n = 1 To M_CustomPopupItemCount
  570.         Load lblPopupItems(n)
  571.         lblPopupItems(n).Caption = "Undo " & CStr(n + 1) & " levels"
  572.         lblPopupItems(n).Visible = True
  573.     Next n
  574.     With picCustomPopup
  575.         .BorderStyle = 0
  576.         .Move .Left, .Top, 120, 70
  577.     End With
  578.     acbMain.CreatePopupForm picCustomPopup.hWnd
  579. End Sub
  580. Private Sub Form_Resize()
  581.     picFrame.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
  582. End Sub
  583. 'Private Methods
  584. '==============
  585. Private Sub p_AddEvent(Caption As String)
  586.     Dim sText As String
  587.     sText = txtEvents.Text
  588.     If Left$(sText, 6) = "(none)" Then
  589.         sText = Caption
  590.     Else
  591.         sText = sText & vbCrLf & Caption
  592.     End If
  593.     txtEvents.Text = sText
  594.     txtEvents.SelStart = Len(sText)
  595. End Sub
  596.